package com.sumainfor.wx.system.fallback;

import com.sumainfor.common.exception.TCException;
import com.sumainfor.common.util.JsonResult;
import com.sumainfor.wx.system.feign.BaseFeignZuul;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * 功能描述:
 *
 * @Auther: zhlu
 * @Date: 2019/1/18 16:03
 * @Description:
 */
@Component
public class FeignZuulFallback implements BaseFeignZuul {

    @Override
    public JsonResult getUserByUnid(String unionid) {
        return JsonResult.error("路由服务器繁忙，请稍后重试！");
    }

    @Override
    public JsonResult getCenterServiceInfo(String userId) {
        return JsonResult.error("路由服务器繁忙，请稍后重试！");
    }

    @Override
    public JsonResult getUser(List<String> ids) {
        return JsonResult.error("路由服务器繁忙，请稍后重试！");
    }

    @Override
    public JsonResult getMessageList(Map<String, Object> params) {
        return JsonResult.error("路由服务器繁忙，请稍后重试！");
    }

    @Override
    public Map<String, Object> getDeptInfoById(String deptId) {
        throw new TCException("路由服务异常");
    }

    @Override
    public JsonResult getAreaInfoForGSByDeptId(String deptId) {
        return JsonResult.error("路由服务异常");
    }

    @Override
    public JsonResult getSysMessageList(Map<String, Object> params) {
        return JsonResult.error("路由服务器繁忙, 请稍后重试");
    }


    ///////////////////////////
    ////zc定义
    //////////////////////////

    /**
     * 转单池查询转单人的信息
     * @param params
     * @return
     */
    @Override
    public JsonResult getPuserListById(Map<String, Object> params) {
        return JsonResult.error("路由服务异常");
    }

    @Override
    public List<Map<String,Object>> getDeptList(Map<String, Object> params) {
        throw new TCException("路由异常");
    }

    @Override
    public JsonResult getAllUserIdAndName() {
        return JsonResult.error("路由器服务异常");
    }

    @Override
    public JsonResult getWoSaleIdList(Map<String, Object> params) {
        return JsonResult.error("路由服务器异常");
    }

    @Override
    public JsonResult getDeptListByType(Map<String, Object> params) {
        return JsonResult.error("路由服务器繁忙");
    }
}
